//
//  GetWechatRegisterCodeApi.m
//  HerconWaterFilter
//
//  Created by Kendama on 2017/5/8.
//  Copyright © 2017年 JianWei Chen. All rights reserved.
//

#import "GetWechatRegisterCodeApi.h"

@implementation GetWechatRegisterCodeApi{
    NSDictionary *_dic;
}

-(id)initWithDic:(NSDictionary *)dic{
    if (self = [super init]) {
        _dic = dic;
    }
    return self;
}

- (NSString *)requestUrl {
    return @"/new/user/send_vcode";
}

- (YTKRequestMethod)requestMethod {
    return YTKRequestMethodPOST;
}

- (id)requestArgument {
    NSMutableDictionary *dic=[NSMutableDictionary getPubdicGuest];
    if (_dic[@"username"]) {
        NSString* base64Text = [NSString encryptUseAES:_dic[@"username"] key:nil];
        
        [dic setObject:base64Text forKey:@"username"];
    }
    [dic setObject:@"3" forKey:@"type"];
    
    NSString *sign=[NSString getSign:dic];
    [dic setObject:sign forKey:@"sign"];
    return dic;
}

- (NSString *)userId {
    return [[[self responseJSONObject] objectForKey:@"userId"] stringValue];
}

- (void)analyseResponseObject {
    //    NSDictionary *dic=[self responseJSONObject];
    
}

- (void)dealloc {
    NSLog(@"RegisterApi dealloc");
}

@end
